package com.hi5.csocso.dao;

import java.util.List;

import com.hi5.csocso.domain.User;

public interface UserDao {

    /**
     * Returns a user with the given ID
     *
     * @param id UserID
     * @return User or {@code null} if does not exists
     */
    User getUser(int id);

    /**
     * Returns a user with the given username and password.
     * Password should be a hash.
     *
     * @param username Username
     * @param password Password, hash is preferable
     * @return User or {@code null} if does not exists
     */
    User getUser(String username, String password);

    /**
     * Returns all user found in the DB. Used only for debug purposes.
     * @return All users
     */
    List<User> getAllUser();

    /**
     * Creates or updates the given user.
     * @param user The user to update/create
     */
    void saveUser(User user);
}
